import javax.sound.midi.Soundbank;

public class Main {
    public static void main(String[] args) {
        MyTree myTree = new MyTree();
        MyTree.Tree tree = myTree.createTree();
//前序遍历
        myTree.preOrder(tree);
        System.out.println();
//中序遍历
        myTree.inOrder(tree);
        System.out.println();
//后序遍历
        myTree.postOrder(tree);
        System.out.println();
//节点个数
        System.out.println("节点个数:");
        System.out.println(myTree.size(tree));
//叶子节点个数
        System.out.println("叶子节点个数:");
        System.out.println(myTree.getLeafNodeCount(tree));
//获得 第k层 节点的个数
        System.out.println("第k层 节点的个数:");
        System.out.println(myTree.getLeafNodeCount(tree,3));
        System.out.println(myTree.getLeafNodeCount(tree,2));
// 获取二叉树的高度
        System.out.println("二叉树高度:");
        System.out.println(myTree.getHeight(tree));
// 检测值为value的元素是否存在
        System.out.println("检测值为value的元素是否存在:");
        MyTree.Tree tree1 = myTree.find(tree,'G');
        if (tree1 != null) {
            System.out.println(tree1.val);
        }



    }
}